package spring_user;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import zttc.itat.model.fileUploadStatus;




public class myProgressListener   {
	private HttpSession session;

	public myProgressListener(HttpServletRequest req) {
		session=req.getSession();
		fileUploadStatus status = new fileUploadStatus();
		session.removeAttribute("status");
		session.setAttribute("status", status);
	}

	/* pBytesRead  ��ĿǰΪֹ��ȡ�ļ��ı�����
	 * pContentLength �ļ��ܴ�С
	 * pItems Ŀǰ���ڶ�ȡ�ڼ����ļ�
	 */
	public  void update(long pBytesRead, long pContentLength, int pItems,String remote) {
		// TODO Auto-generated method stub
		//System.out.println("ok2");
		fileUploadStatus status = (fileUploadStatus) session.getAttribute("status");
		status.setPBytesRead(pBytesRead);
		status.setPContentLength(pContentLength);
		status.setFilepath(remote);
		status.setPItems(pItems);
	}

}
